#!/bin/sh

ver="sync_3.4"

cd postgresql

rmdir -p $ver

mkdir $ver
mkdir $ver/DEBIAN
cp DEBIAN/conffiles $ver/DEBIAN
cp DEBIAN/control $ver/DEBIAN
mkdir $ver/etc
mkdir $ver/etc/cron.d
cp etc/cron.d/sync $ver/etc/cron.d
mkdir $ver/etc/sync
cp etc/sync/nodes.conf $ver/etc/sync
cp etc/sync/nodes.sec $ver/etc/sync
cp etc/sync/sync.conf $ver/etc/sync
cp etc/sync/sync.isql $ver/etc/sync
cp etc/sync/tables.sh $ver/etc/sync
mkdir $ver/usr
mkdir $ver/usr/bin
cp usr/bin/archive $ver/usr/bin
cp usr/bin/nodeconf $ver/usr/bin
cp usr/bin/office.to $ver/usr/bin
cp usr/bin/syncctl $ver/usr/bin
mkdir $ver/usr/lib
mkdir $ver/usr/lib/sync
cp usr/lib/sync/common $ver/usr/lib/sync
cp usr/lib/sync/postgre.sql $ver/usr/lib/sync
mkdir $ver/usr/share
mkdir $ver/usr/share/doc
mkdir $ver/usr/share/doc/sync
cp usr/share/doc/sync/changelog.Debian $ver/usr/share/doc/sync
cp usr/share/doc/sync/README.Debian $ver/usr/share/doc/sync
cp usr/share/doc/sync/copyright $ver/usr/share/doc/sync
gzip -9 $ver/usr/share/doc/sync/*
mkdir $ver/var
mkdir $ver/var/opt
mkdir $ver/var/opt/arch
mkdir $ver/var/spool
mkdir $ver/var/spool/uucppublic
md5deep -rl $ver/usr > $ver/DEBIAN/md5sums

fakeroot dpkg-deb --build $ver
